package cn.mw.cmdb.enums;

public enum DatasourceFilterTypeEnum {

    group("group", "仅分组"),
    property("property", "仅属性"),
    groupAndProperty("orgNames", "分组+属性");

    private String type;
    private String desc;

    DatasourceFilterTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getDesc(){
        return this.desc;
    }

    public String getType(){
        return this.type;
    }

    public static String getDescByType(String type) {
        for (DatasourceFilterTypeEnum r : DatasourceFilterTypeEnum.values()) {
            if (r.getType().equals(type)) {
                return r.getDesc();
            }
        }
        return "";
    }

}
